package com.fy.merchant.controller;

import com.fy.commodity.api.CommodityService;
import com.fy.commodity.resdto.CommodityShowDto;
import com.fy.common.api.CommonResult;
import com.fy.merchant.common.vo.IdAndMerchantid;
import com.fy.merchant.reqvo.QueryCommodityVo;
import com.fy.merchant.resvo.CommodityListVo;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.util.List;

@RestController
@Api(tags = "商品管理")
@RequestMapping("commodity")
public class CommodityManagementController {
    @Autowired
    CommodityService commodityService;

    @ApiOperation("查询所有")
    @GetMapping(value = "findAll")

    public CommonResult findAll(@RequestBody QueryCommodityVo queryCommodityVo) {
        List<CommodityShowDto> commodityShowDtos = commodityService.queryCommodityList();
        return CommonResult.success(new CommodityListVo());
    }

    @ApiOperation("是否上架")
    @PostMapping(value = "isputaway")
    public CommonResult isShow(@RequestBody IdAndMerchantid idAndMerchantid) {
        
        return CommonResult.success();
    }

}
